package com.climber.android.component.webview.mvp.ui

import android.text.TextUtils
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.climber.android.commonsdk.app.AppConstants
import com.climber.android.commonsdk.arouter.ARouterPathConstants
import com.climber.android.component.webview.mvp.ui.base.BaseWebActivity

/**
 * Created by Mikes at 2019-11-04 10:02
 */
@Route(path = ARouterPathConstants.PATH_WEB_BROWSER)
class WebBrowserActivity : BaseWebActivity(){
    @Autowired(name = "urlLink")
    @JvmField
    var urlLink: String = ""

    override fun isSupportDynamicTitle(): Boolean = TextUtils.isEmpty(intent.getStringExtra(AppConstants.PARAM_WEB_TITLE))

    override fun preferHtmlUrl(): String = urlLink

    override fun initIntentData() {
        urlLink = intent.getStringExtra(AppConstants.PARAM_WEB_URL) ?: ""
    }

    override fun injectWebInitData() {
        mPresenter.loadHtmlFile()
    }

}